package com.hzit.manager.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.hzit.manager.valid.AddGroup;
import com.hzit.manager.valid.ListValue;
import com.hzit.manager.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 
 * 
 * @author hbxfwf
 * @email 2568783935@gmail.com
 * @date 2023-06-06 15:58:41
 */
@Data
@TableName("tb_brand")

public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 *
	 */
	@TableId
	// @NotBlank(message="id不能为空")
	@NotBlank(message = "id不能为空！",groups = {UpdateGroup.class})
	private String id;
	/**
	 * 品牌名称
	 */
	@NotBlank(message = "品牌名不能为空!",groups = {AddGroup.class,UpdateGroup.class})
	private String name;
	/**
	 * 品牌首字母
	 */
	@NotBlank(message = "首字符不能为空！")
	@Pattern(regexp="[a-zA-Z]+",message = "首字符必须为字母！",groups = {AddGroup.class,UpdateGroup.class})
	private String firstChar;

	/**
	 * 自定义验证规则
	 */
	@NotBlank(message = "性别不能为空！")
	@ListValue(value = {"M","F"},groups = {AddGroup.class,UpdateGroup.class},message = "性别只能是M或F！")
	@TableField(exist = false)
	private String sex;
}
